varying vec4 gl_Color;
uniform float life;
uniform vec4 endColor;

void main(void)
{
	vec2 correctedCoord = (gl_TexCoord[0].xy-0.5)*2.0;
	float center = 1.0-abs(length(correctedCoord*2.5*(2-life)));
	float alpha = center*life;

	gl_FragColor = vec4(gl_Color.rgb*(1.0+center*center*20*life*life*life*life)*(life+0.2), alpha*gl_Color.a);

	gl_FragColor += endColor*0.00001;
	//vec3 color = mix(endColor.rgb, startColor.rgb, life);
	//gl_FragColor = vec4(color*(1.0+center), alpha);
	
}
    